package com.designCreator.view
{
	import com.designCreator.command.FabricDesignsCommand;
	import com.designCreator.controls.ConfigurationTabs;
	import com.designCreator.notifications.NotificationNames;
	
	import org.puremvc.as3.interfaces.IMediator;
	import org.puremvc.as3.interfaces.INotification;
	import org.puremvc.as3.patterns.mediator.Mediator;
	
	public class ConfigurationTabsMediator extends Mediator implements IMediator
	{
		public static const NAME : String = "ConfigurationTabsMediator";
		
		public function get configurationTab() : ConfigurationTabs
		{
			return viewComponent as ConfigurationTabs;
		}
		
		public function ConfigurationTabsMediator( configTab : ConfigurationTabs )
		{
			super( NAME, configTab );
		}
		
		override public function onRegister():void
		{
			//register mediator for each child tab 
			facade.registerMediator( new FabricTabContentMediator(configurationTab.fabricTab));
			facade.registerMediator( new StyleTabContentMediator(configurationTab.styleTab));
			facade.registerMediator( new ConfigurationDesignMediator(ConfigurationDesignMediator.FABRIC_NAME,configurationTab.fabricTab.fabricConfig));
			facade.registerMediator( new ConfigurationDesignMediator(ConfigurationDesignMediator.STYLE_NAME,configurationTab.styleTab.styleConfigArea));
		}
		
		override public function listNotificationInterests() : Array
		{
			return [
				/*NotificationNames.DISPLAY_FEEDS,
				NotificationNames.DISPLAY_FEED,
				NotificationNames.DISPLAY_PODCAST*/
				];
		}
		
		override public function handleNotification( note : INotification ) : void
		{
			/*switch ( note.getName() )
			{
				case NotificationNames.DISPLAY_FEEDS:
					flexcaster.views.selectedIndex = FEEDS_VIEW;
					break;
				
				case NotificationNames.DISPLAY_FEED:
					flexcaster.views.selectedIndex = FEED_VIEW;
					break;
				
				case NotificationNames.DISPLAY_PODCAST:
					flexcaster.views.selectedIndex = PODCAST_VIEW;
					break;
			
			}*/
		}
	}
}